package com.zhangjianling.premp.server.sys.impl;

import com.zhangjianling.premp.dao.sys.BaseInfoDao;
import com.zhangjianling.premp.entity.sys.SysBaseInfo;
import com.zhangjianling.premp.server.sys.BaseInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Iterator;

@Service
@Transactional
public class BaseInfoServiceImpl implements BaseInfoService {
	@Resource
	private BaseInfoDao baseInfoDao;

	
	@Override
	public SysBaseInfo getDetail() {
		SysBaseInfo sysBaseInfo = null;
		Iterable<SysBaseInfo> findAll = baseInfoDao.findAll();
		Iterator<SysBaseInfo> iterator = findAll.iterator();
		while(iterator.hasNext()) {
			sysBaseInfo = iterator.next();
		}
		return sysBaseInfo;
	}

	@Override
	public void save(SysBaseInfo baseInfo) {
		baseInfoDao.save(baseInfo);
	}

}
